package org.dreamwork.floatingball.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import org.dreamwork.floatingball.util.ViewManager;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by seth.yang on 2017/3/31
 */

public class FloatingBallService extends Service {
    private ExecutorService pool;

    @Override
    public IBinder onBind (Intent intent) {
        return null;
    }

    @Override
    public void onCreate () {
        pool = Executors.newCachedThreadPool ();
        ViewManager.getInstance (this, pool).showBall ();
        super.onCreate ();
    }

    @Override
    public void onDestroy () {
        if (pool != null) {
            pool.shutdownNow ();
        }
        super.onDestroy ();
    }
}